<?php
/**
 * 网站参数设置
 * $Id: settings.php 238 2011-01-13 08:53:47Z bwanglei@gmail.com $
 */

require_once './globals.php';

if ($_SERVER['REQUEST_METHOD']=='POST' && $action='update') {
	$name_setting = addslashes($_POST['name_setting']);
	$value_setting = addslashes($_POST['value_setting']);
	$update_sql = 'UPDATE `'.DB_PREFIX.'settings` SET `value`=\''.$value_setting.'\' WHERE `name`=\''.$name_setting.'\'';
	$DB->query($update_sql);
	$CACHE->updateCache('options');
	header('Location: '.$_SERVER['REQUEST_URI']);
}

$blog_title = '网站参数设置 - '.$blogname;
$get_c_sql = 'SELECT * FROM `'.DB_PREFIX.'settings` WHERE `type_one`=\'y\'';
$result_so = $DB->query($get_c_sql);
$one_settings = array();
while ($setting = $DB->fetch_array($result_so)) {
	$one_settings[] = $setting;
}
include_once TEMPLATE_PATH.'/header.php';
include_once TEMPLATE_PATH.'/settings.php';
include_once TEMPLATE_PATH.'/sidebar.php';
include_once TEMPLATE_PATH.'/footer.php';
